home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / OldSrc / CH9 / SRC / DCIRCLE.CLS < prev    next >
Encoding:
Text File  |  1995-11-14  |  546 b   |  22 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "DistortCircle"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = False
  8. Option Explicit
  9.  
  10. Public period As Single
  11. Public amplitude As Single
  12. ' ************************************************
  13. ' Apply a shape distorting transformation to
  14. ' the point.
  15. ' ************************************************
  16. Sub Distort(x As Single, y As Single, z As Single)
  17. Dim D As Single
  18.  
  19.     D = Sqr(x * x + z * z)
  20.     y = y + amplitude * Sin(D * 6.28 / period)
  21. End Sub
  22.